rem - Function time profiling @echo off prep /om /ft %1.exe if errorlevel 1 goto done profile %1.exe if errorlevel 1 goto done prep /m %1 if errorlevel 1 goto done plist %1 :done rem - Total of 3 profile sessions. You could take an average or just consider the relative rem - execution time. rem - Remove plist %1 and paste other lines (from prep to if error level...) rem - twice for 3 runs. rem - prep /om /ft %1.exe rem - if errorlevel 1 goto done rem - profile %1.exe rem - if errorlevel 1 goto done rem - prep /m %1 rem - if errorlevel 1 goto done rem - prep /om /ft %1.exe rem - if errorlevel 1 goto done rem - profile %1.exe rem - if errorlevel 1 goto done rem - prep /m %1 rem - if errorlevel 1 goto done rem - prep /om /ft %1.exe rem - if errorlevel 1 goto done rem - profile %1.exe rem - if errorlevel 1 goto done rem - prep /m %1 rem - :done ________________________________________________________________________________________ @echo off plist /st /t lame.pbt > lameProfiling.txt :done rem - PRODUCE A TAB DELIMETED REPORT FOR PROFILER GRAPH PRESENTATION rem - rem - /nologo Surpasses microsoft's logo information rem - /st Sorts the listing by timing rem - /t Produced a tab-separated output for use with profiler.xlm rem - lame.pbt lists the data from profiling rem - > directs the output to a file rem - This produces a text file output of the total profiling rem - run this after your profiling is done ________________________________________________________________________________________ rem - Line profiling for a one module only @echo off prep /om /lc /excall /inc formatBitstream.c(0-0) %1 if errorlevel 1 goto done profile %1 prep /m %1 plist %1 :done rem - /lc is line profiling rem - /excall exclude all modules rem - /inc includes some part of a module. Your part is to specifiy which parts ________________________________________________________________________________________ For more information about batch file samples search for PREP, PROFILE, PLIST in the MSDN Library. Navigate through the documents and you should come across samples. But that is basically what you need to do as far as profiling is concerened. I have included line profiling for completeness only. ________________________________________________________________________________________ If you want to produce graphs for the profiling: Open profile.xlm (can't remember if it was profile.xlm or profiler.xlm) anyway it is in the Bin directory of the Vc98 folder insode Microsoft Visual Studio Program folder. Create a new document and open your text file in there. Either press Ctrl+T for a bar graph of the function timing or Ctrl+C for hit count graph.